<%
    Users user = Trader.getUser(request.getParameter("uid"));
	wstrader.task.quality.SampleReceived task = user.quality.samplereceived;

	task.getRequest().setRequest(request);
	task.getResponse().setResponse(response,out);
	
	if (!user.Authenticated()) {
		response.sendRedirect("logon.jsp");
		return;
	}
	((Tasks)task.getOwner()).clearFocus();
	task.setFocus(true);	
	Trader.window_width = "90%";	
	ResultSet rs;
%>
<style type="text/css">
<!--
.style3 {font-family: Arial}
.style6 {font-size: 12px}
-->
</style>
<%@include file="../header.jsp"%>
<script language="javascript">
function clickCardView()
{
	var form = document.formMain;
	form.action = "quality.samplereceived.card-view.jsp";
	form.submit();	
}

function cardViewClick(row)
{
	var form = document.formMain;
	form.sample_master.value = row.id;
	dblClick(row);
}

function doFilter()
{
	var form = document.formMain;
	form.action = "quality.samplereceived.jsp";
	form.submit();
}
</script>
<form method="POST" name="formMain" action="" onSubmit="return dosearch()">				  
  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
      <th colspan="2" align="left" scope="col"><img src="images/samplereceived.jpg" width="300" height="30"></th>
      <th scope="col">&nbsp;</th>
      <th scope="col">&nbsp;</th>
      <th colspan="4" scope="col"><input type="hidden" name="uid"        id="uid"       value="<%=user.getuid()%>">
        <input type="hidden" name="task_id"    id = "task_id"   value="0">
        <input name="type" type="hidden" id="type"> <input name="sample_type" type="hidden" id="sample_type" value="R">
        <input name="sample_master" type="hidden" id="sample_master" value="0"></th>
    </tr>
    <tr align="left">
      <td colspan="8">
	    <table>
    <tr>
      <td width="150" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Received Date </span></strong></td>
      <td width="150" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Received From </span></strong></td>
      <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Category</span></strong></td>
      <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Origin</span></strong></td>
      <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Grade</span></strong></td>
      <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Status</span></strong></td>
    </tr>
    <tr>
      <td height="32">
	  <select name="received_date" size="9" id="received_date" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		<%@include file="include/SampleSentDateList.jsp"%>
      </select>
	  </td>
      <td>
	  <select name="received_from" size="9" id="received_from" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		  <option value="0" selected>All</option>
	  	<%
			task.getResponse().setOption(task.getSellerList());
			task.getResponse().setSelected("received_from");
		%>	  
      </select>
	  </td>
      <td>
	  <select name="category_id" size="9" id="category_id" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:160px;border:0">
	  	<option value="0" selected>All</option>
	  	<option value="1" >Approval</option>
	  	<option value="2" >Pre-Shipment/Delivery</option>
	  	<option value="3" >Shipment/Delivery</option>
	  	<option value="4" >Stock</option>
	  	<option value="5" >Reference/Type/Offer</option>	
		<%task.getResponse().setSelected("category_id");%>									      
	  </select>
	  </td>
      <td>
	  <select name="origin_id" size="9" id="origin_id" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		  <option value="0" selected>All</option>
	  	<%
			task.getResponse().setOption("origin_master","name");
			task.getResponse().setSelected("origin_id");
		%>	  
      </select>
	  </td>
      <td><select name="grade_id" size="9" id="grade_id" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		  <option value="0" selected>All</option>	  
        <%
			task.getResponse().setOption("grade_master","name");
			task.getResponse().setSelected("grade_id");
		%>
      </select></td>
      <td>
	  <select name="status" size="9" id="status" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		  	<option value="0" selected>All</option>
      </select>
	  </td>
    </tr>
	  
	  </table>	  </td>
    </tr>
    <tr valign="top">
      <td colspan="8">	  <table width="100%"  border="1" cellspacing="1" cellpadding="1">
        <tr bordercolor="#EEEEEE">
          <td width="4%" height="31" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Id</span></strong></td>
          <td width="8%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">QSR Ref. </span></strong><strong><span class="style29 style3 style6"></span></strong></td>
          <td width="6%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Recd Date </span></strong></td>
          <td width="9%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Recd From </span></strong></td>
          <td width="5%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Category</span></strong></td>
          <td width="11%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Contract No. &nbsp;</span></strong><strong></strong><strong></strong></td>
          <td width="8%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Seller Ref. </span></strong></td>
          <td width="7%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">&nbsp;Location</span></strong></td>
          <td width="6%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Lot No. &nbsp;</span></strong></td>
          <td width="7%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Origin</span></strong></td>
          <td width="19%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Grade</span></strong></td>
          <td width="4%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Tons</span></strong></td>
          <td width="6%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">App/Rej</span></strong><strong><span class="style29 style3 style6"></span></strong><strong></strong><strong></strong></td>
        </tr>
        <tr>
          <td colspan="13">
            <div id=scroll1 style="BORDER:0px ; OVERFLOW: auto; WIDTH: 100%; HEIGHT: 260px;">
              <%@include file="quality.samplereceived.list.details.jsp"%>
            </div></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="right">&nbsp;&nbsp;</td>
      <td align="right">&nbsp;</td>
      <td align="right">&nbsp;</td>
      <td align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="right" valign="middle">&nbsp;&nbsp;</td>
      <td align="right" valign="middle">&nbsp;</td>
      <td align="right" valign="middle">&nbsp;</td>
      <td align="right" valign="middle"><img src="images/cardview.jpg" width="55" height="18" onClick="clickCardView();"></td>
    </tr>
  </table></form>


<%@include file="../footer.jsp"%>

